﻿using Microsoft.AspNetCore.Http;

namespace StudentManagementSystem.Common.CustomMiddleWares
{
    public class HeaderMiddleware
    {
        private readonly RequestDelegate _next;

        public HeaderMiddleware(RequestDelegate next)
        {
            _next = next;
        }

        public async Task Invoke(HttpContext context)
        {
            Console.WriteLine($"{context.Request.Method}   {context.Request.Path}");
            _next(context);
            Console.WriteLine(context.Response.StatusCode);
        }
    }
}
